package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.RegisterBean;
import com.common.retrofit.service.HaiNingService;

import java.util.List;

import rx.Observable;
import rx.Subscriber;

public class UpdatePswMethods extends BaseMethods {

    private static UpdatePswMethods m_ins = null;

    public static UpdatePswMethods getInstance() {
        if (m_ins == null) {
            synchronized (UpdatePswMethods.class) {
                if (m_ins == null) {
                    m_ins = new UpdatePswMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void updatepwd(Subscriber<List> subscriber,
                      String uid ,
                      String oldpwd  ,String newpwd  ) {
        Observable observable = initService().updatepwd(System.currentTimeMillis()+"",
                "6eb01744f29658aed35e24d0b5eeb943",uid,oldpwd,newpwd
        );
        toSubscribe(observable, subscriber);
    }
}
